package com.opennice.util.web;

import java.util.HashSet;
import java.util.Set;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.web.context.support.WebApplicationContextUtils;

import com.opennice.hessian.external.homeImpl.HelloImpl;

public class InitSystemListener implements ServletContextListener {

	
	private static final Log log = LogFactory.getLog(InitSystemListener.class);
	@Override
	public void contextInitialized(ServletContextEvent event) {
		// TODO Auto-generated method stub

		BeanFactory factory=WebApplicationContextUtils.getWebApplicationContext(event.getServletContext());
		HelloImpl helloImpl=(HelloImpl) factory.getBean("helloImpl");
		helloImpl.sayHello("LoadSystemInfo");
		Set<Integer> set = new HashSet<Integer>();
		set.add(1);
		set.add(3);
		UserBackListCache.BLACKLIST_USERID_SET=set;
		System.out.println(set.size());
		log.info("loadsysteminfo");
	}
	
	
	@Override
	public void contextDestroyed(ServletContextEvent event) {
		// TODO Auto-generated method stub

	}

}
